package com.mjc.book.util;

import lombok.Data;

import java.io.Serializable;

/**
 * 统一返回格式
 */
@Data
public class Result implements Serializable {

    //响应码
    private int code;

    private Object obj;

    public Result(int code) {
        this.code = code;
    }

    public Result() {

    }

    public Result success(int code, Object object){
       Result result = new Result();
           result.setCode(code);
           result.setObj(object);
           return result;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

}

